<template>

</template>

<script>
  import wx from 'weixin-js-sdk'

  export default {
    mounted () {
      this.jump()
    },
    methods: {
      jump () {
        let search = window.location.search
        let code = search.substring(search.indexOf('=') + 1, search.indexOf('&'))
        let userId = this.$route.query.userId
        this.verifyUser(code, userId)
      },
      verifyUser (code, userId) {
        this.$http({
          url: this.$http.adornUrl(`/mp/user/check/${userId}/${code}`),
          method: 'get'
        }).then(({data}) => {
          this.$messagebox.alert(data.msg).then(action => {
            wx.closeWindow()
          })
        })
      }
    }
  }
</script>

<style scoped>

</style>
